package com.guoyansoft.controller;

import com.guoyansoft.config.R;
import com.guoyansoft.model.pojo.CustomerAndAddress;
import com.guoyansoft.model.service.CustomerAndAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/customerAndAddress")
public class CustomerAndAddressController {
    @Autowired
    private CustomerAndAddressService customerAndAddressService;
    @RequestMapping("/save")
    public R save(CustomerAndAddress customerAndAddress){
        R save = customerAndAddressService.save(customerAndAddress);
        return save;
    }
    @RequestMapping("/queryByCustomerId")
    public R queryByCustomerId(Integer customerId){
        R r = customerAndAddressService.queryByCustomerId(customerId);
        return r;
    }

}
